// Access to standard .NET System
 using System;
 using System.Collections.Generic;
 using System.Text;
 
 // Access to the public Robocode API
 using Robocode;
 
 // The namespace with your initials, in this case FNL is the initials
 namespace GpRobot
 {
     // The name of your robot is MyRobot, and the robot type is Robot
     class Hi : Robot
     {
         // The main method of your robot containing robot logics
         public override void Run()
         {
             // -- Initialization of the robot --
             
             // Here we turn the robot to point upwards, and move the gun 90 degrees
             TurnLeft(Heading - 90);
             TurnGunRight(90);
       
             // Infinite loop making sure this robot runs till the end of the battle round
             while (true)
             {
                 // -- Commands that are repeated forever --
         
                 // Move our robot 5000 pixels ahead
                 Ahead(5000);
                 
                 // Turn the robot 90 degrees
                 TurnRight(90);
                 
                 // Our robot will move along the borders of the battle field
                 // by repeating the above two statements.
             }
         }
         
         // Robot event handler, when the robot sees another robot
         public override void OnScannedRobot(ScannedRobotEvent e)
         {
	     Abs(Cos(Add(X(),MaxY())));
         }
		 
		 public static double Add(double x, double y)
		 {
			return x + y;
		 }
		 
		 public static double Sub(double x, double y)
		 {
			return x - y;
		 }		 
		 
		 public static double Mul(double x, double y)
		 {
			return x * y;
		 }
		 
		 public static double Div(double x, double y)
		 {
			return (y == 0) ? 0 : x / y;
		 }
		 
		 public static double Abs(double x)
		 {
			return Math.Abs(x);
		 }
		 
		 public static double Neg(double x)
		 {
			return -x;
		 }
		 
		 public static double Sin(double x)
		 {
			return Math.Sin(x);
		 }
		 
		 public static double Cos(double x)
		 {
			return Math.Cos(x);
		 }
		 
		 public static double ArcSin(double x)
		 {
			return Math.Asin(x);
		 }
		 
		 public static double ArcCos(double x)
		 {
			return Math.Acos(x);
		 }
		 
		 public static double Firing(double x)
		 {
			if(x < 0) return 0;
			else
			{
				Fire(x);
				return 1;
			}
		 }
     }
 }
